package distributedRE.model;

import java.util.ArrayList;

public class Session {

	private static int NEXT_SESSION_NUMBER = 0;
	
	private int sessionNumber;
	private ArrayList<ArrayList<Document>> documentLists;
	private ArrayList<QueryDatabase> qDbPairs;
	private int id_experiment;
	
	
	public Session(Integer id_e){
		this(NEXT_SESSION_NUMBER++,id_e);
	}
	
	private Session(int i, Integer id_e) {
		sessionNumber = i;
		id_experiment = id_e.intValue();
		documentLists = new ArrayList<ArrayList<Document>>();
		qDbPairs = new ArrayList<QueryDatabase>();
		
	}

	public void add(ArrayList<Document> documentList,
			QueryDatabase queryDatabase) {
		documentLists.add(documentList);
		qDbPairs.add(queryDatabase);
	
	}

	public ArrayList<ArrayList<Document>> getDocumentLists() {
		
		return documentLists;

	}

	public ArrayList<QueryDatabase> getQueryDatabases() {
		
		return qDbPairs;
	
	}

	public int getId() {
		
		return sessionNumber;
	}

	public int getExperiment_id() {
		
		return id_experiment;

	}

	public boolean equals(Object o){
		Session s = (Session)o;
		return (s.id_experiment == id_experiment && s.sessionNumber == sessionNumber);
	}
	
}
